/*
 * @Description: IBE信息化平台
 * @Author: IBE
 * @LastEditors: chen
 */
import request from "@/utils/request"
const BASE_URL = process.env.VUE_APP_BASE_URL_HRM

/**
 * 查询绩效考核列表
 * @param {*} data
 */
export function hrmPerformanceQueryListAPI(data) {
	return request({
		url: BASE_URL + "hrmAchievementAppraisal/queryAppraisalPageList",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 查询每个绩效状态的数量
 * @param {*} data
 */
export function hrmPerformanceQueryStatusNumPI(data) {
	return request({
		url: BASE_URL + "hrmAchievementAppraisal/queryAppraisalStatusNum",
		method: "post",
		data: data
	})
}

/**
 * 添加考核
 * @param {*} data
 */
export function hrmPerformanceAddAPI(data) {
	return request({
		url: BASE_URL + "hrmAchievementAppraisal/addAppraisal",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 修改考核
 * @param {*} data
 */
export function hrmPerformanceSetAPI(data) {
	return request({
		url: BASE_URL + "hrmAchievementAppraisal/setAppraisal",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 修改考核状态
 * @param {*} data
 */
export function hrmPerformanceUpdateStatusAPI(data) {
	return request({
		url: BASE_URL + "hrmAchievementAppraisal/updateAppraisalStatus",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 删除考核
 * @param {*} data
 */
export function hrmPerformanceDeleteAPI(id) {
	return request({
		url: BASE_URL + `hrmAchievementAppraisal/delete/${id}`,
		method: "post"
	})
}

/**
 * 删除归档考核
 * @param {*} data
 */
export function delAppraisalPlanOfFile(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/delAppraisalPlanOfFile",
		method: "post",
		data: data
	})
}

/**
 * 终止考核
 * @param {*} data
 */
export function hrmPerformanceStopAPI(id) {
	return request({
		url: BASE_URL + `hrmAchievementAppraisal/stopAppraisal/${id}`,
		method: "post"
	})
}

/**
 * 查询考核详情
 * @param {*} data
 */
export function hrmPerformanceDetailAPI(id) {
	return request({
		url: BASE_URL + `hrmAchievementAppraisal/queryAppraisalById/${id}`,
		method: "post"
	})
}

/**
 * 修改考核状态
 * @param {*} data
 */
export function hrmPerformanceQuerylEmployeeListAPI(data) {
	return request({
		url: BASE_URL + "hrmAchievementAppraisal/queryAppraisalEmployeeList",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 查询员工考核详情
 * @param {*} data
 */
export function hrmPerformanceEmployeeDetailAPI(id) {
	return request({
		url: BASE_URL + `hrmAchievementAppraisal/queryEmployeeDetail/${id}`,
		method: "post"
	})
}

/**
 * 绩效档案详情统计
 * @param {*} data
 */
export function hrmPerformanceEmployeeQueryAppraisalNumAPI(id) {
	return request({
		url: BASE_URL + `hrmAchievementAppraisal/queryEmployeeAppraisalCount/${id}`,
		method: "post"
	})
}

/**
 * 查询考核详情
 * @param {*} data
 */
export function hrmPerformanceAppraisalDetailAPI(id) {
	return request({
		url: BASE_URL + `hrmAchievementAppraisal/queryEmployeeDetail/${id}`,
		method: "post"
	})
}

/**
 * 绩效档案详情列表
 * @param {*} data
 */
export function hrmPerformanceQueryEmployeeAppraisalAPI(data) {
	return request({
		url: BASE_URL + "hrmAchievementAppraisal/queryEmployeeAppraisal",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 通过绩效id查询员工列表
 * @param {*} data
 */
export function hrmPerformanceQueryEmployeeByAppraisalIdAPI(data) {
	return request({
		url: BASE_URL + "hrmAchievementAppraisal/queryEmployeeListByAppraisalId",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 查询绩效考核列表
 * @param {*} data
 */
export function hrmAppraisalPlanQueryListAPI(data) {
	return request({
		url: BASE_URL + "hrmAppraisalPlan/queryPageList",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 查询每个绩效状态的数量
 * @param {*} data
 */
export function hrmAppraisalPlanQueryAppraisalStatusNumAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/queryAppraisalStatusNum",
		method: "post",
		data: data
	})
}

/*
 * 新建kpi计划
 */
export function hrmAppraisalPlanAddAppraisalPlanAPI(data) {
	return request({
		url: BASE_URL + "hrmAppraisalPlan/addAppraisalPlan",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 删除考核计划
 * @param {*} data
 */
export function hrmAppraisalPlanDelAppraisalPlanAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/delAppraisalPlan",
		method: "post",
		data: data
	})
}

/**
 * 查看考核设置
 */
export function hrmAppraisalPlanQuerySetting(data) {
	return request({
		url: BASE_URL + "hrmAppraisalPlan/querySetting",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 查看考核人员表头
 * @param {*} data
 */
export function hrmAppraisalPlanQueryEmployeeListHeadInfoAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/queryEmployeeListHeadInfo",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 查看考核人员列表
 * @param {*} data
 */
export function hrmAppraisalPlanQueryEmployeeListAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/queryEmployeeList",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 查询高级筛选字段
 * @param {*} data
 */
export function hrmAppraisalPlanQueryFieldAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/queryField",
		method: "post",
		data: data
	})
}

/**
 * 检查并考核计划
 * @param {*} data
 */
export function hrmAppraisalPlanCheckAppraisalPlanAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/checkAppraisalPlan",
		method: "post",
		data: data
	})
}

/**
 * 启动考核计划
 * @param {*} data
 */
export function hrmAppraisalPlanStartAppraisalPlanAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/startAppraisalPlan",
		method: "post",
		data: data
	})
}

/**
 * 添加考核人员
 * @param {*} data
 */
export function hrmAppraisalPlanAddEmployeeListAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/addAppraisalEmployeeList",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 移除考核人员
 * @param {*} data
 */
export function hrmAppraisalPlanDelEmployeeListAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/delAppraisalEmployee",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 关闭考核计划
 * @param {*} data
 */
export function hrmAppraisalPlanTerminationPlanAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/terminationPlan",
		method: "post",
		data: data
	})
}

/**
 * 开启评分
 * @param {*} data
 */
export function hrmAppraisalPlanOpenScoringAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/openScoring",
		method: "post",
		data: data
	})
}

/**
 * 绩效面谈
 * @param {*} data
 */
export function hrmAppraisalPlanToInterviewAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/toInterview",
		method: "post",
		data: data
	})
}

/**
 * 绩效归档
 * @param {*} data
 */
export function hrmAppraisalPlanPlaceOnFileAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/placeOnFile",
		method: "post",
		data: data
	})
}

/**
 * 考核绩效列表
 * @param {*} data
 */
export function hrmAppraisalEmployeePlanQueryAppraisalListAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/queryAppraisalResultPageList",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 考核绩效考核人员阶段数据
 * @param {*} data
 */
export function hrmAppraisalEmployeeQueryStageEmployeeNumAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalEmployee/queryStageEmployeeNum",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 考核绩效考核人员分数数据
 * @param {*} data
 */
export function hrmAppraisalEmployeeQueryScoreEmployeeNumAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalEmployee/queryScoreEmployeeNum",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 考核计划结果设置等级数量列表
 * @param {*} data
 */
export function hrmAppraisalEmployeeQueryAppraisalPlanResultLevelNumAPI(data) {
	return request({
		url: BASE_URL + "/hrmAppraisalPlan/queryAppraisalPlanResultLevelNum",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 查询绩效档案列表
 * @param {*} data
 */
export function hrmEmployeeAchievementFileQueryAppraisalFileListAPI(data) {
	return request({
		url: BASE_URL + "/hrmEmployeeAchievementFile/queryAppraisalFileList",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 查询员工考核绩效列表
 * @param {*} data
 */
export function hrmEmployeeAchievementFileQueryEmployeeAppraisalListAPI(data) {
	return request({
		url: BASE_URL + "/hrmEmployeeAchievementFile/queryEmployeeAppraisalList",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 根据权限获取人员和组织
 */
export function queryInspectionDeptEmployeeList(data) {
	return request({
		url: BASE_URL + `/hrmEmployee/queryInspectionDeptEmployeeList/${data}`,
		method: "post",
		data: data
	})
}

/**
 * 根据权限获取人员列表
 */
export function queryInspectionAllEmployeeList(data) {
	return request({
		url: BASE_URL + "hrmEmployee/queryInspectionAllEmployeeList",
		method: "post",
		data: data
	})
}

/**
 * 绩效档案删除记录
 */
export function delAppraisalEmployee(data) {
	return request({
		url: BASE_URL + "/hrmEmployeeAchievementFile/delAppraisalFileRecordList",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 绩效档案多选删除
 */
export function delAppraisalFileRecordListOfAll(data) {
	return request({
		url:
			BASE_URL + "/hrmEmployeeAchievementFile/delAppraisalFileRecordListOfAll",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}
